package edu.sctu.zhengsenwen.month201506.day20150614.textthreadutil;

/**
 * Created by user15 on 2015/6/15.
 */
public class Test1 {

    public static int i = 0;
    public static int j = 0;
    public static int res = 0;

    synchronized static void add() {
        i++;
        j++;
        res = i + j;
    }

    synchronized static void show() {
        if (i != j) {

            System.out.println(i + "+" + j + "=" + res);
        }

        if (res >= Short.MAX_VALUE) {

            System.out.println("完成测试");
            System.exit(0);
        }
    }
}
